package entity;

//用户类
public class User {
	 //用户类型数组
	public static final String [] type =new String[] {"普通用户","管理员"};
	//final 类型 的 用户类型 常量 
	public static final int Administrator = 3;
	public static final int vip = 1;
	public static final int ssvip = 2;
	public static final int guest = 0;
	//邮箱
	private String email;
	//性别
	private String sex;
	//密码
	private String password;
	//用户类型
	private Integer typeid;
	//name
	private String name;
	//grade
	private Integer grade;

	
	public User() {
		super();
	}
	
	public User(String email, String sex, String password, Integer typeid, String name, Integer grade) {
		super();
		this.email = email;
		this.sex = sex;
		this.password = password;
		this.typeid = typeid;
		this.name = name;
		this.grade = grade;
	}
	
	//string to Integer  用户类型 字符串 转数组下标
	public static Integer Stringtouser(String s){
		Integer td=0;
		System.out.println(s);
		if(s.equals("管理员")) {
			td=1;
		}
		return td;
	}
	//通过用户下标获取用户类型
	public  String getuserType(){
		return type[typeid];
	}
	
	
	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public Integer getTypeid() {
		return typeid;
	}

	public void setTypeid(Integer typeid) {
		this.typeid = typeid;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getGrade() {
		return grade;
	}

	public void setGrade(Integer grade) {
		this.grade = grade;
	}

	public static String[] getType() {
		return type;
	}

	public static int getAdministrator() {
		return Administrator;
	}

	public static int getVip() {
		return vip;
	}

	public static int getSsvip() {
		return ssvip;
	}

	public static int getGuest() {
		return guest;
	}

	public static void main(String[] args) {
		new User();
	}
	
	
}
